package com.jml.api.controller;

import java.util.ArrayList;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {

		@RequestMapping("/indexController")
		public String indexController(Map<String,Object> result){
			System.out.println("indexController.....index");
			result.put("name","jml");
			result.put("sex","0");
			ArrayList<String> list = new ArrayList<>();
			list.add("zs");
			list.add("lisi");
			result.put("userlist",list);
			return "index";
		}

		@Autowired
		private JdbcTemplate jdbcTemplate;
		public void fun1(){
			jdbcTemplate.update("insert into users values(null,?,?);", "jml", 12);
		}




}
